{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Calculate and Plot Activity\n",
    "\n",
    "\n",
    "Given an existing database for Al-Zn, we would like to calculate the activity of the liquid.\n",
    "\n",
    "## Experimental activity results\n",
    "\n",
    "In order to make sure we are correct, we'll compare the values with experimental results.\n",
    "Experimental activities are digtized from Fig 18 in A. Yazawa, Y.K. Lee, Thermodynamic Studies of the Liquid Aluminum Alloy Systems, Trans. Japan Inst. Met. 11 (1970) 411–418. https://doi.org/10.2320/matertrans1960.11.411.\n",
    "\n",
    "The measurements at at 1073 K and they used a reference state of the pure Zn at that temperature.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "exp_x_zn =   [0.0482, 0.1990, 0.3550, 0.5045, 0.6549, 0.8070, 0.9569]\n",
    "exp_acr_zn = [0.1154, 0.3765, 0.5411, 0.6433, 0.7352, 0.8384, 0.9531]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Set up the database\n",
    "\n",
    "Al-Zn database is taken from S. Mey, Reevaluation of the Al-Zn system, Zeitschrift F{ü}r Met. 84 (1993) 451–455."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pycalphad import Database, equilibrium, variables as v\n",
    "import numpy as np\n",
    "\n",
    "dbf = Database('alzn_mey.tdb') \n",
    "\n",
    "comps = ['AL', 'ZN', 'VA']\n",
    "phases = list(dbf.phases.keys())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Calculate the reference state\n",
    "\n",
    "Because all chemical activities must be specified with a reference state, we're going to choose a reference state as the pure element at the same temperature, consistent with the experimental data."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "ref_eq = equilibrium(dbf, comps, phases, {v.P: 101325, v.T: 1023, v.X('ZN'): 1})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Calculate the equilibria\n",
    "\n",
    "Do the calculation over the composition range"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "eq = equilibrium(dbf, comps, phases, {v.P: 1013325, v.T: 1023, v.X('ZN'): (0, 1, 0.005)})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Get the chemical potentials and calculate activity\n",
    "\n",
    "We need to select the chemical potentials from the xarray Dataset and calculate the activity."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "chempot_ref = ref_eq.MU.sel(component='ZN').squeeze()\n",
    "chempot = eq.MU.sel(component='ZN').squeeze()\n",
    "\n",
    "acr_zn = np.exp((chempot - chempot_ref)/(8.315*1023))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot the result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x11352f5c0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARQAAAEWCAYAAACnuGhyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VGX2wPHvAQKhoxQFQhNCJxCIVEVQlOKCooiABRtY\n186uuFZ2fzYs69pRESvFQlkFUVgQUanSQXpLQkmA0FJIOb8/7hCHYUICzM1MJufzPPOQufedO2eG\nmTP3vve95xVVxRhjAqFEsAMwxoQPSyjGmICxhGKMCRhLKMaYgLGEYowJGEsoxpiAsYQS4kTkBhH5\noYBt14hIN5dDQhwficgBEVnk9vOZosMSiotEZK7nS1emgO3ri4iKSKnjy1T1c1W9oiCPV9UWqjrX\ns61nROSzMwo8fxcBlwNRqtred6Un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48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(eq.X.sel(component='ZN', vertex=0).squeeze(), acr_zn, label='Calculated')\n",
    "# add experimental data\n",
    "plt.scatter(exp_x_zn, exp_acr_zn, label='Yazawa 1970')\n",
    "\n",
    "plt.xlim((0, 1))\n",
    "plt.ylim((0, 1))\n",
    "plt.gca().set_aspect(1)\n",
    "plt.xlabel('X(ZN)')\n",
    "plt.ylabel('ACR(ZN)')\n",
    "plt.title('Activity of Zn at 1073K')\n",
    "plt.legend(loc=0)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [conda env:espei]",
   "language": "python",
   "name": "conda-env-espei-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
